﻿using System;

using UIKit;
using UmengSocial;
using System.Collections.Generic;
using Foundation;
using CoreGraphics;
using UMAnalytics;

namespace UMengTouchDemo
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle)
            : base(handle)
        {
            
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            UMSocialData.AppKey = @"55b8446f67e58e56850059ff";
            UMSocialWechatHandler.SetWXAppId("wx6b3269922a496cef", "aa6a40cc5890b437beb7d4b5ea805f99", @"http://www.umeng.com/social");
            UMSocialQQHandler.SetQQWithAppId("1104566589", "aWuj7H9dIoZSVIKw", @"http://www.umeng.com/social");
            var btn = new UIButton(new CGRect(100, 100, 100, 100));
            btn.SetTitleColor(UIColor.Red, UIControlState.Normal);
            btn.SetTitle("Share To ...", UIControlState.Normal);
            View.AddSubview(btn);
            
            btn.TouchUpInside += (_, __) =>
            {
                UMSocialSnsService.PresentSnsController(this, "55bc15f2e0f55a428f007bb1",
                    "Test",
                    UIImage.FromBundle("1.jpeg"),  
                    new []{ UMSocialSnsPlatformManager.UMShareToQQ, UMSocialSnsPlatformManager.UMShareToWechatSession, UMSocialSnsPlatformManager.UMShareToSina },
                    new De());
            };
          
        }

    

        public class De : UMSocialUIDelegate
        {
            public De()
            {
                
            }

            public override void DidFinishGetUMSocialDataInViewController(UMSocialResponseEntity response)
            {

                Console.WriteLine("HH");
            }
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

